package com.ixiaowo.springcouldconsumermovie.config;

import com.netflix.client.config.IClientConfig;
import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * 自定义Ribbon  负载策略  java代码方式
 */
@Configuration
public class TestConfiguration {
//    @Resource
//     IClientConfig clientConfig;

    /**
     * 配置随机策略
     * @param
     * @return
     */
    @Bean
    public IRule ribbonRule(){
        return new RandomRule();
    }
}
